package spring.context;


import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class GeneusContext implements ApplicationContextAware {

	static ApplicationContext ctx= null;
	
	@Override
	public void setApplicationContext(ApplicationContext arg0)
			throws BeansException {
		if (arg0!= null)
			ctx= arg0;
		
	}
	public synchronized static ApplicationContext getApplicationContext(){
		if (ctx!=null)
		return ctx;
		ctx = new ClassPathXmlApplicationContext(new String[]{"beans.xml","applicationContext.xml"});
		return ctx;
	}
}
